
ifndef CFG
CFG=Debug
endif

ifndef COMPILER
COMPILER=g++
endif

ifeq "$(CFG)" "Release"
CFLAGS= -W -fexceptions -finline-functions -D_LINUX -DNDEBUG -D_THREAD_SAFE -D_LIB -D_MBCS -fpack-struct=4
LIBS= -l
ILFLAGS= -I -I../../dock/oogetopt -L../../homebase/linux/
TARGET=
endif

ifeq "$(CFG)" "Debug"
CFLAGS= -W -g -O0 -fexceptions -finline-functions -D_LINUX -D_DEBUG -D_THREAD_SAFE -D_LIB -D_MBCS -fpack-struct=4
LIBS= -loogetopt -lscuba -lboost_filesystem -lark
ILFLAGS= -I../../scuba -I../../ark -I../../dock/oogetopt -I../../backpack/ammo -I../../dock/oogetopt  -L../../homebase/linux/
TARGET= Debug
endif

SOURCE_FILES= $(wildcard *.cpp)

OBJS=$(patsubst %.cpp, %.o,$(SOURCE_FILES))

.PHONY:all
all: $(TARGET)

$(TARGET): $(OBJS)
	$(COMPILER) $(CFLAGS) $(ILFLAGS) $(GLOBALS) $(OBJS) $(LIBS) -o $(TARGET) 

%.o: %.cpp
	$(COMPILER) $(CFLAGS) $(ILFLAGS) $(GLOBALS) -o $@ -c $<

.PHONY:clean
clean:
	 -rm -f $(OBJS) $(TARGET)

